package com.design.ticket;

import java.util.Random;

public class TrainTicke implements Ticke {


    private String from;

    private String to;

    private int price;

    public TrainTicke(String from, String to) {
        this.from = from;
        this.to = to;
    }

    @Override
    public void showInfo(String bunk) {
        this.price = new Random().nextInt(500);
        System.out.println(from + "->" + to + ":" + bunk + "价格:" + this.price);
    }
}
